import { BaseLogic } from "../../common/base/BaseLogic";
import { BaseState } from "../../common/base/BaseState";
import Router from "../../routes/Router";
import { RouteNames } from "../../routes/Routes";
import PageOneState from "./PageOneState";

export default class PageOneLogc implements BaseLogic<PageOneState> {
    state: PageOneState;

    setState(state:PageOneState) {
        this.state = state
    }
    init(args): void {
        cc.log("page one init")
        cc.log("args is",args)
    }

    dispose(): void {
        cc.log("page one dispose")
    }
    
    close() {
        Router.back()
    }

    openNew() {
        Router.to(RouteNames.PAGE_TWO)
    }

    changeText() {
        this.state.testText = "1243"
    }
}